~include file="header.html" tit = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~
<title>文件详情 - ~$tit~~</title>~include file="head.html" tit = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~
<style type="text/css">
    .aplayer{
        width:100%;
             margin: 0px; 
             box-shadow: 0 0px 0px 0 rgba(0,0,0,.14);
    }
    .aplayer .aplayer-pic{
        height: 100px;
    width: 100px;
    }
    .aplayer .aplayer-info{
        margin-left: 100px;
    }
    .aplayer .aplayer-info .aplayer-music .aplayer-title {
    font-size: 25px;
}
.aplayer .aplayer-info {
    margin-left: 100px;
    padding: 25px 7px 0 10px;
    height: 66px;
    box-sizing: border-box;
}
</style>
<div class="container">
    <div class="row">
        <div class="col-md-9">
            <div class="well bs-component " style="padding: 0px;" align="center">
                  <div id="m_player">
  <div id="aplayer" class="aplayer"></div>
</div>
            </div>
            <div class="panel panel-default">
                <div class="panel-body" style="padding: 0px;">
                    <ul class="nav nav-tabs" style="margin-bottom: 15px;">
                        <li class="active"><a href="#wl" data-toggle="tab"><i class="fa fa-link" aria-hidden="true"></i> 文件外链</a>
                        </li>
                        <li><a href="#dy" data-toggle="tab"><i class="fa fa-code" aria-hidden="true"></i> 调用</a>
                        </li>
                        <li><a href="#qrcode" data-toggle="tab"><i class="fa fa-qrcode" aria-hidden="true"></i> 二维码</a>
                        </li>
                        <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="bootstrap-elements.html" data-target="#"><i class="fa fa-share" aria-hidden="true"></i> 创建分享<span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href="#gkfx" data-toggle="tab"><i class="fa fa-eye" aria-hidden="true"></i> 公开分享</a>
                                </li>
                                <li class="divider"></li>
                                <li><a href="#smfx" data-toggle="tab"><i class="fa fa-eye-slash" aria-hidden="true"></i>私密分享</a>
                                </li>
                            </ul>
                        </li>
                        <li><a href="#gl" data-toggle="tab"><i class="fa fa-cog" aria-hidden="true"></i> 管理</a>
                        </li>
                        <li><a href="#xq" onclick="xiangqing()" data-toggle="tab"><i class="fa fa-info" aria-hidden="true"></i> 详情</a>
                        </li>
                    </ul>
                    <div id="myTabContent" class="tab-content" style="padding: 19px;">
                        <div class="tab-pane fade" id="xq">
                            <div class="row" align="center">
                                <table class="table table-bordered xq" style="width:80%;">
                                    <tr>
                                        <th width="97">上传者：</td>
                                            <td width="233" style="word-break: normal;" id="file_hash"></td>
                                            <th width="110">上传时间：</td>
                                                <td width="122" id="put_time"></td>
                                    </tr>
                                    <tr>
                                        <th>mimetype：</td>
                                            <td id="m_type"></td>
                                            <th>大小(字节)：</td>
                                                <td id="file_size"></td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="gl">
                            <div class="row" align="center">
                                <div class="col-md-3"></div>
                                <div class="col-md-3">
                                    <button id="s1" onclick="delete_share();" class="btn btn-raised btn-primary"><i class="fa fa-minus-circle" aria-hidden="true"></i> 取消所有分享</button>
                                </div>
                                <div class="col-md-2">
                                    <button id="s2" onclick="delete_confirm();" class="btn btn-raised btn-danger"><i class="fa fa-close" aria-hidden="true"></i> 删除文件</button>
                                </div>
                                <div class="col-md-3"></div>
                            </div>
                        </div>
                        <div class="tab-pane fade active in" id="wl">
                            <div class="row">
                                <div class="col-md-2">
                                    <lable>外链地址：</lable>
                                </div>
                                <div class="col-md-8">
                                    <input type="text" class="form-control" id="yuantu" value="~$fileurl~~">
                                </div>
                                <div class="col-md-2"><a id="fuzhi" data-clipboard-target="yuantu" class="btn btn-raised btn-primary" data-content="复制成功" data-toggle="snackbar" data-timeout="2000">复制</a>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="dy">
                            <div class="row">
                                <div class="col-md-2">
                                    <lable>APlayer：</lable>
                                </div>
                                <div class="col-md-8">
                                    <textarea id="htmldy" rows="3" class="form-control">&lt;iframe src=&quot;~$zzurl~~views/player.php?key=~$key~~&quot; width=&quot;407&quot; scrolling=&quot;no&quot;frameborder=&quot;0&quot;height=&quot;70&quot;&gt;&lt;/iframe&gt;</textarea>
                                </div>
                                <div class="col-md-2"><a id="fuzhi1" data-clipboard-target="htmldy" class="btn btn-raised btn-primary" data-content="复制成功" data-toggle="snackbar" data-timeout="2000">复制</a>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-2">
                                    <lable>HTML5播放器：</lable>
                                </div>
                                <div class="col-md-8">
                                    <textarea id="mddy" rows="3" class="form-control">&lt;audio src=&quot;~$fileurl~~&quot; controls=&quot;controls&quot;&gt;  &lt;/audio&gt;</textarea>
                                </div>
                                <div class="col-md-2"><a id="fuzhi2" data-clipboard-target="mddy" class="btn btn-raised btn-primary" data-content="复制成功" data-toggle="snackbar" data-timeout="2000">复制</a>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="qrcode">
                            <div class="row">
                                <div class="col-md-3">
                                    <img style="width:100%;" src="https://pan.baidu.com/share/qrcode?w=260&h=260&url=~$fileurl~~">
                                    <div align="center">原图外链</div>
                                </div>
                                <div class="col-md-3">
                                    <img style="width:100%;" src="https://pan.baidu.com/share/qrcode?w=260&h=260&url=~$zzurl~~views/pic.php?key=~$key~~">
                                    <div align="center">当前页面</div>
                                </div>
                                <div class="col-md-6">
                                    <br>
                                    <div class="alert alert-dismissible alert-warning">
                                        <h4>注意!</h4>
                                        <p>本页面为私有页面，请勿将本页URL分享给不受信任的人。如需分享文件，请直接发送文件外链URL或创建分享链接给对方。</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="gkfx">
                            <div id="gk">
                                <form id="bd" method="post">
                                    <div class="row">
                                        <div class="col-md-3">
                                            <lable>请给你的文件起个名字：</lable>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <div class="input-group">
                                                    <input type="text" class="form-control" id="fname" name="fname">
                                                    <div class="input-group-addon">.~$filetype~~</div>
                                                </div>
                                            </div>
                                            <input style="display:none;" id="ftype" name="ftype" value="open" type="text" />
                                            <input style="display:none;" id="fkey" name="fkey" value="~$key~~" type="text" />
                                        </div>
                                </form>
                                <div class="col-md-2">
                                    <button id="copen" class="btn btn-raised btn-primary">创建</button>
                                </div>
                                </div>
                            </div>
                            <div id="result_open" style="display:none;">
                                <div class="row">
                                    <div class="col-md-2">
                                        <lable>分享页URL：</lable>
                                    </div>
                                    <div class="col-md-8">
                                        <input type="text" class="form-control" id="fxurl" name="fxurl">
                                    </div>
                                    <div class="col-md-2">
                                        <button id="fuzhi3" data-clipboard-target="fxurl" class="btn btn-raised btn-primary" data-content="复制成功" data-toggle="snackbar" data-timeout="2000" class="btn btn-raised btn-primary">复制</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane fade" id="smfx">
                            <div id="sm">
                                <form id="bds" method="post">
                                    <div class="row">
                                        <div class="col-md-3">
                                            <lable>请给你的文件起个名字：</lable>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <div class="input-group">
                                                    <input type="text" class="form-control" id="fname" name="fname">
                                                    <div class="input-group-addon">.~$filetype~~</div>
                                                </div>
                                            </div>
                                            <input style="display:none;" id="ftype" name="ftype" value="lock" type="text" />
                                            <input style="display:none;" id="fkey" name="fkey" value="~$key~~" type="text" />
                                        </div>
                                </form>
                                <div class="col-md-2">
                                    <button id="clock" class="btn btn-raised btn-primary">创建</button>
                                </div>
                                </div>
                            </div>
                            <div id="result_lock" style="display:none;">
                                <div class="row">
                                    <div class="col-md-3">
                                        <lable>分享页URL及密码：</lable>
                                    </div>
                                    <div class="col-md-7">
                                        <div class="form-inline">
                                            <input type="text" class="form-control" id="fxurl-lock" name="fxurl-lock">
                                            <input type="text" class="form-control" id="pwd-lock" name="pwd-lock">
                                            <button id="fuzhi4" class="btn btn-raised btn-primary" data-content="复制成功" data-toggle="snackbar" data-timeout="2000" class="btn btn-raised btn-primary">复制</button>
                                        </div>
                                    </div>
                                    <div class="col-md-2"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <br>
            <br>
        </div>
        <div class="col-md-3">
     ~include file="side.html" titm = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~
        </div>
    </div>~include file="footer.html" titm = $tit head=$head zzurl=$zzurl isvisitor=$isVisitor userinfo=$userinfo~~
    <script type="text/javascript" src="~$zzurl~~content/themes/material/js/ZeroClipboard.js"></script>
    <script src="~$zzurl~~includes/APlayer/APlayer.min.js"></script>
    <script type="text/javascript">
   var ap1 = new APlayer({
    element: document.getElementById('aplayer'),
    narrow: false,
    autoplay: true,
    showlrc: false,
    mutex: true,
    theme: '#b2dae6',
    music: {
        title: '~$filename~~',
        author: '',
        url: '~$fileurl~~',
        
    }
});


var load ="0";
        function xiangqing() {
            $("#guanli").hide();
            $("#fileurl").hide();
            $("#filecode").hide();
            $("#xiangqing").show();
            if (load == "0") {
                $.get("../includes/getinfo.php?key=~$key~~", function(data, status) {
                    var xqq = data.split(".");
                    $("#file_hash").html(xqq[1]);
                    $("#file_size").html(xqq[0]);
                    $("#m_type").html(xqq[2]);
                    $("#put_time").html(xqq[3]);
                });
            }
            load = "1";
        }
        var clip = new ZeroClipboard(document.getElementById("fuzhi"), {});
        var clip1 = new ZeroClipboard(document.getElementById("fuzhi1"), {});
        var clip2 = new ZeroClipboard(document.getElementById("fuzhi2"), {});
        var clip3 = new ZeroClipboard(document.getElementById("fuzhi3"), {});
        var clip4 = new ZeroClipboard(document.getElementById("fuzhi4"), {});
        $("#copen").click(function() {
            $("#copen").attr("disabled", true);
            $.post("../includes/create_share.php", $("#bd").serialize(), function(data) {
                var ge = data.split(".");
                var ftype = ge[0];
                var result = ge[1];
                var code = ge[2];
                if (result == "ok") {
                    if (ftype == "open") {
                        $('#fxurl').val("~$zzurl~~" + ge[3] + "." + ge[4]);
                        $("#gk").hide();
                        $("#result_open").show();
                        $.snackbar({
                            content: "创建成功",
                            timeout: 2000
                        });
                    } else {}
                } else {
                    $("#copen").attr("disabled", false);
                    $.snackbar({
                        content: code,
                        timeout: 2000
                    });
                }
            });
        });
        $("#clock").click(function() {
            $("#clock").attr("disabled", true);
            $.post("../includes/create_share.php", $("#bds").serialize(), function(data) {
                var ge = data.split(".");
                var ftype = ge[0];
                var result = ge[1];
                var code = ge[2];
                if (result == "ok") {
                    if (ftype == "open") {} else {
                        var pwd = ge[3];
                        $('#fxurl-lock').val("~$zzurl~~" + ge[4] + "." + ge[5]);
                        $('#pwd-lock').val("密码：" + pwd);
                        $("#sm").hide();
                        $("#fuzhi4").attr("data-clipboard-text", "链接：~$zzurl~~" + ge[4] + "." + ge[5] + " 密码：" + pwd);
                        $("#result_lock").show();
                        $.snackbar({
                            content: "创建成功",
                            timeout: 2000
                        });
                    }
                } else {
                    $("#clock").attr("disabled", false);
                    $.snackbar({
                        content: code,
                        timeout: 2000
                    });
                }
            });
        });

        function delete_confirm() {
            var returnVal = window.confirm("删除文件不可恢复，并且所有分享都将取消，确定删除吗？", "确认删除");
            if (!returnVal) {} else {
                $("#s2").attr("disabled", true);
                $.post("../includes/delete_file.php", {
                    key: "~$key~~"
                }, function(data) {
                    var pe = data.split(".");
                    if (pe[0] == "ok") {
                        $.snackbar({
                            content: pe[1],
                            timeout: 2000
                        });
                        setTimeout(function() {
                            window.location = "~$zzurl~~"
                        }, 2000);
                    } else {
                        $.snackbar({
                            content: pe[1],
                            timeout: 2000
                        });
                        $("#s2").attr("disabled", false);
                    }
                });
            }
        }

        function delete_share() {
            var returnVal1 = window.confirm("确定要取消该文件的所有分享？", "确认取消");
            if (!returnVal1) {} else {
                $("#s1").attr("disabled", true);
                $.post("../includes/delete_share.php", {
                    key: "~$key~~"
                }, function(data) {
                    var pe1 = data.split(".");
                    if (pe1[0] == "ok") {
                        $.snackbar({
                            content: pe1[1],
                            timeout: 2000
                        });
                        $("#s1").attr("disabled", false);
                    } else {
                        $.snackbar({
                            content: pe1[1],
                            timeout: 2000
                        });
                        $("#s1").attr("disabled", false);
                    }
                });
            }
        }
    </script>